<?php
namespace App\Service\CommodityService;

use App\Service\BaseService;
use App\Service\Code\Normal;
use App\Model\CommodityModel\SupplierCompany;

/**
 * 供应商服务
 *
 * @author chenyun
 */
class SupplierCompanyService extends BaseService
{

    const CACHE_KEY = 'supplier_company_query_';

    /**
     * 三方授权平台批量查询服务
     *
     * @param array $param            
     * @return mixed
     */
    public function queryPayAccountBySupplierId(string $supplierId)
    {
        if(empty($supplierId) ) {
            return Normal::returnCode(Normal::FAIL, "供应商ID不能为空");
        }
        $where[]=["ID","=",$supplierId];
        $result = SupplierCompany::instance()->select([
            'IsOpenPayAccount as isOpenPayAccount',
            'PayMethod as payMethod',
            'PayAccount as payAccount',
            'PayUserId as payUserId',
            'PayUserBankAcount as payUserBankAcount',
            'PayUserPayScale as payUserPayScale',
            'PayUserForeignAccount as payUserForeignAccount'
        ])->where($where)->where('IsDeleted',0)->get()->toArray();
        return Normal::returnCode(Normal::SUC,"获取成功",$result);
    }
}